//
//  ChangeColorViewController.m
//  DelegateDemo
//
//  Created by UniHan_iMac on 17/3/27.
//  Copyright © 2017年 UniHan_iMac. All rights reserved.
//

#import "ChangeColorViewController.h"

@interface ChangeColorViewController ()

@end

@implementation ChangeColorViewController

- (IBAction)ChangeColor:(id)sender {
    
    // 调用代理的协议方法
    if([self.delegate respondsToSelector:@selector(ChangeColor:ChangeText:)] == YES)
    {
        [self.delegate ChangeColor:1 ChangeText:@"绿色"];
    }
    
    if([self.delegate respondsToSelector:@selector(ChangeButtonColor)] == YES)
    {
        [self.delegate ChangeButtonColor];
    }
    
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
